//封装cookie

import Cookies from 'js-cookie'
const tokenKey = "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJsdjExMTEiLCJpYXQiOjE2NDYzNTU2NDEsImV4cCI6MTY0NjQ0MjA0MSwiaXNzIjoiemFsIiwidXNlckFjY291bnQiOiJsdjExMTEiLCJ1c2VyUGhvbmUiOiLmnKrnu5HlrpoiLCJzZXgiOiLmnKrnn6UiLCJ1c2VyTmlja25hbWUiOiLpu4TpobXlubPlj7DnlKjmiLcyZWVlMjEiLCJwZXJtaXNzaW9uIjoiQURNSU4iLCJhdmF0YXIiOiJodHRwczovL3Nob3AtMTMwNTg2OTEwOC5jb3MuYXAtbmFuamluZy5teXFjbG91ZC5jb20vc2hvcC9kZWZhdWx0LWF2YXRhci5wbmciLCJ1c2VySWQiOjEwLCJlbWFpbCI6Iuacque7keWumiJ9.xV2M_uF2FVQ-rkN9HhAOA78CCgHeojRCwl2xa0k2uLM"
//获取token
function getToken(){
    setToken()
    return Cookies.get('tokenKey')
}
//设置token的函数，该函数应该传个值，token写死了所以没有传值
function setToken(){
    return Cookies.set('tokenKey', tokenKey)
}
//移除token
function removeToken(){
    return Cookies.remove(tokenKey)
}

const cookie = {
    getToken,
    setToken,
    removeToken
}

export default cookie